package cn.iocoder.yudao.module.water.dal.mysql.proplan;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.water.dal.dataobject.proplan.ProPlanDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.water.controller.admin.proplan.vo.*;

/**
 * 计划数据 Mapper
 *
 * @author 左达成
 */
@Mapper
public interface ProPlanMapper extends BaseMapperX<ProPlanDO> {

    default PageResult<ProPlanDO> selectPage(ProPlanPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ProPlanDO>()
                .betweenIfPresent(ProPlanDO::getDate, reqVO.getDate())
                .orderByDesc(ProPlanDO::getId));
    }

    default List<ProPlanDO> selectList(ProPlanExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ProPlanDO>()
                .betweenIfPresent(ProPlanDO::getDate, reqVO.getDate())
                .orderByDesc(ProPlanDO::getId));
    }

}
